import { createRouter, createWebHistory } from 'vue-router'

import Home from "../components/core/Home.vue"
import HappyRoot from "../components/core/HappyRoot.vue"
import User from "../components/core/User.vue"
import userbody from "../components/user/Userbody.vue"
import userothers from "../components/user/Userothers.vue"

import userInfo from "../components/core/userInfo.vue"
import personal from "../components/userInfo/personal.vue"
import account from "../components/userInfo/account.vue"
import message from "../components/userInfo/message.vue"
import messageBox from "../components/userInfo/messageBox.vue"
import notice1 from "../components/userInfo/notice1.vue"
import notice2 from "../components/userInfo/notice2.vue"
import notice3 from "../components/userInfo/notice3.vue"
import noticeSet from "../components/userInfo/noticeSet.vue"

import Create from "../components/core/Create.vue"
import createA from "../components/create/createArticle.vue"
import createM from "../components/create/createMessage.vue"
import litter from "../components/create/litter.vue"

import contentPage from "../components/core/contentPage.vue"
import contentPage2 from "../components/core/contentPage2.vue"
import collectionsPage from "../components/core/collectionsPage.vue"


const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/', component: Home,
            meta: { loginType: false }
        },
        {
            path: '/happyroot', component: HappyRoot,
            meta: { loginType: true }
        },
        {
            path: '/user', component: User,
            children: [
                { path: '', redirect: "/user/Userbody" },
                { path: 'userbody', component: userbody },
                { path: 'userothers', component: userothers },
            ],
            meta: { loginType: true }
        },
        {
            path: '/userInfo', component: userInfo,
            children: [
                { path: '', redirect: "/userInfo/personal" },
                { path: 'personal', component: personal },
                { path: 'account', component: account },
                { path: 'message', component: message },
                { path: 'messageBox', component: messageBox },
                { path: 'notice1', component: notice1 },
                { path: 'notice2', component: notice2 },
                { path: 'notice3', component: notice3 },
                { path: 'noticeSet', component: noticeSet },
            ],
            meta: { loginType: true }
        },
        {
            path: '/create', component: Create,
            children: [
                // { path: '', redirect: "/create/createA" },
                { path: 'createA', component: createA },
                { path: 'createM', component: createM },
                { path: 'litter', component: litter },
            ],
            meta: { loginType: true }
        },
        {
            path: '/contentPage', component: contentPage,
            meta: { loginType: true }
        },
        {
            path: '/contentPage2', component: contentPage2,
            meta: { loginType: true }
        },
        {
            path: '/collectionsPage', component: collectionsPage,
            meta: { loginType: true }
        }
    ],
})

export default router